import pygame,sys
from pygame.locals import *
pygame.init()
screen = pygame.display.set_mode((700,700))
for ib in range(30):
    for ia in range(30):
        pygame.draw.rect(screen,(255,255,255),(50+ia*20,50+ib*20,17,17))
while True:
    for event in pygame.event.get():
        print(event)
        if event.type == QUIT:
            pygame.quit()
            sys.exit()
    pygame.display.update()